package com.sicaolong.partterndesign._02strategy._01;

import lombok.AllArgsConstructor;
import lombok.Data;

@AllArgsConstructor
@Data
public class Dog implements MyComparable2<Dog>{
    private String name;
    private int age;


    //从小到大排序
    @Override
    public int compareTo(Dog dog) {
        return Integer.compare(dog.age,age);
    }
}
